<?php


namespace app\controller;


use think\facade\Db;

class ActivityTime
{
    //获取活动时间
    public function getVal(){
        $res = Db::table("activity")->where('activity_id',1)->find();
        if($res){
            return ['status'=>200,'msg'=>'ok','data'=>$res];
        }
    }
    //判断是否在活动内
    public function checkTime(){
        $val = $this->getVal()['data'];
        $time = time();
        if(strtotime($val['date1'])>$time || $time<strtotime($val['date2']))return true;else return  false;
    }
}